import Mock from 'mockjs'

const isFocus = Mock.mock({
    "isFocus": true
})

const userInfo = Mock.mock({
    "id": '@id',
    "name": '@cname',
    "role": '@boolean'
})

Mock.mock('/mock/user/focus/isFocus', 'get', () => {
    return {
        code: 20000,
        data: isFocus
    }
})

Mock.mock('/mock/user/info', 'get', (userId) => {
    if (userId) {
        return {
            code: 20000,
            data: userInfo
        }
    }
    return null;
})